﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using $myprojectname$.Domain.Abstract;


namespace $myprojectname$.Mvc.Controllers
{
/// <summary>
/// Product Controller class.
/// </summary>
[$myprojectname$.Infrastructure.Filters.Authorize(LoginPath = "/Account/Login")]
[$myprojectname$.Infrastructure.Filters.HandleError(View = "Error")]
public class ProductController : Controller
{
	private IProductRepository repository;
    
    /// <summary>
    /// Controller constructor.
    /// </summary>
    /// <param name="productRepository">The product repository.</param>
    public ProductController(IProductRepository productRepository) {
         repository = productRepository;
    }

    /// <summary>
    /// It get the list of products.
    /// </summary>
    /// <returns></returns>
    public ActionResult List()
    {
        return View(repository.GetProducts());
    }
}
}